
from curl_cffi import requests
impersonate = requests.impersonate.BrowserType.safari180

res1 = requests.get("http://htgs.ccgp.gov.cn/GS8/genCodeImg?t=0.8796792701220804",impersonate=impersonate)
# print(res1)
msg = res1.json()['msg']
print(msg)


url = "http://htgs.ccgp.gov.cn/GS8/contractpublish/getContractByAjax?contractSign=0"
# page = 0
for page in range(0,4):
    res2 = requests.post(url,data={
        "code":"pageNoChange",
        "currentPage":f"{page}",
        "codeResult":msg
    })
    print(res2)

    for item in res2.json()['rows']:
        url = f'http://htgs.ccgp.gov.cn/GS8/contractpublish/detail/{item["uuid"]}?contractSign=0'
        res3 = requests.get(url)
        print(res3.text)
        break





